﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BO;
using BrightIdeasSoftware;
namespace UIControls.Grid
{
   public static class ColumnHelper
    {
       public static OLVColumn NewColumn(string colName = "", int colWidth = 100,string colTitle="", AspectGetterDelegate aspectGetter=null)
       {
           var col = new OLVColumn();
           col.AspectName = colName;
           col.Text = colTitle;
           col.Width = colWidth;
           col.AspectGetter = aspectGetter;
           return col;
       }
       public static OLVColumn ReportColumn(string tableName, string fieldName, string colTitle = "", int colWidth = 100, AspectGetterDelegate aspectGetter = null)
       {
           var col = new OLVColumn();
           col.AspectName = fieldName;
           col.Text = DescriptionHandler.GetDescription(tableName, fieldName);         
           col.Width = colWidth;
           col.AspectGetter = aspectGetter;
           return col;
       }
    }
}
